<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        //自定义对象方式2
        //属性不用加var,并且使用 : 而不是=
        //注意属性之间有 , 隔开
        var person={
            name:"gz", //不写逗号,会报错
            age: 18,
            hi:function (){
                console.log("你好")
            },
            say:function (){
                console.log(this.name+" "+this.age)
            }
        }

        person.hi()
        person.say()
    </script>
</head>
<body>

</body>
</html>